package nl.scalasim.ui

import scala.swing.{Swing, TextArea}
import nl.scalasim.cli.TileMapPrinter
import nl.scalasim.controlactors.Choreographer
import java.awt.Font

/**
 * Provides a view on the simulation map. 
 *
 * @author Yigal Duppen
 * @since Nov 7, 2010
 */
class MapView(level: Level) extends TextArea {

  private val MONO = new Font(Font.MONOSPACED, Font.PLAIN, 18)

  font = MONO
  rows = level.choreographer.map.depth
  columns = level.choreographer.map.width
  editable = false


  def updateMap() = Swing.onEDT({
    text = TileMapPrinter.dump(level.choreographer)
  })
}